package onlineCodingQuizSubmission

import org.springframework.cloud.contract.spec.Contract

[Contract.make {
    request {
        method("GET")
        url(value(producer("/api/v3/onlineCodingSubmission/1/logs")
                , consumer(regex("/api/v3/onlineCodingSubmission/\\d+/logs"))))
    }
    response {
        status(200)
        body("""
            {
                "status":2,
                "logs":"abcdefg"
            }
        """)
        bodyMatchers {
            jsonPath('$.status', byRegex(number()))
            jsonPath('$.logs', byRegex("[\\s\\S]+"))
        }
        headers {
            contentType(applicationJsonUtf8())
        }
    }
},
 Contract.make {
     request {
         method("GET")
         url("/api/v3/onlineCodingSubmission/users/1/assignments/1/quizzess/1/logs")
     }
     response {
         status(200)
     }
 }
]
